package DesignMode.DependecyInversion;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}22:18
 */
public class inversion {
    public static void main(String[] args) {

    }
}

//完成Person接受消息的功能
//方式1
class Email{
    public String getInfo(){
        return "Email_HelloWorld";
    }
}

class Person{
    public void receive(Email email){
        System.out.println(email.getInfo());
    }
}
//方法2
interface IReceiver{
    public String getInfo();
}